package com.rpj.stauy.config;

import com.rpj.stauy.service.MyHighAiService;
import dev.langchain4j.model.chat.ChatModel;
import dev.langchain4j.model.openai.OpenAiChatModel;
import dev.langchain4j.service.AiServices;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class LowAndHighConfig {

    @Bean("qwen")
    public ChatModel chatModelQwen(){
        return OpenAiChatModel.builder().modelName("qwen-plus")
                .baseUrl("https://dashscope.aliyuncs.com/compatible-mode/v1")
                .apiKey(System.getenv("aliQwen_api"))
                .build();
    }

    @Bean("deepseek")
    public ChatModel chatModelDeepseek(){
        return OpenAiChatModel.builder().modelName("deepseek-chat")
                .baseUrl("https://api.deepseek.com")
                .apiKey(System.getenv("deepseek_api"))
                .build();
    }

    @Bean("aiService")
    public MyHighAiService myHighAiService(){
        return AiServices.create(MyHighAiService.class,chatModelQwen());
    }
}
